﻿using Castle.Windsor;
using Castle.MicroKernel.Registration;
using MM.Web.Controllers;
using System.Reflection;
using System.Web.Mvc;

namespace MM.Bootstrapper.Configurators
{
    public class ControllerConfigurator : IConfigurator
    {
        #region Miembros de IConfigurator

        public void Configure(IWindsorContainer container)
        {
            ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory(container));

            container.Register(
               AllTypes.Of<ICustomerController>()
               .FromAssembly(typeof(ICustomerController).Assembly)
               .Configure(cf => cf.LifeStyle.Transient)
               );
        }


        #endregion
    }
}
